import { CSSProperties } from 'react'
import classNames from 'classnames'

export const DISPLAY_NAME_MENU_ITEM = 'MenuItem'

export interface MenuItemProps {
  index?: string
  /**配置不可点击 */
  disabled?: boolean
  className?: string
  style?: CSSProperties
}

// 获取组件配置的class
export const getMenuItemClassNames = (
  props: MenuItemProps,
  extendClass?: () => Object
) => {
  const { className, disabled } = props
  return classNames(
    'menu-item',
    className,
    {
      'is-disabled': disabled,
    },
    extendClass && extendClass()
  )
}
